home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UNIXTOOL / UNIXLIB37B / !UnixLib37_src_clib_h_math < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  3.1 KB  |  113 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/math,v $
  4.  * $Date: 1996/10/30 21:58:58 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: math,v $
  10.  * Revision 1.2  1996/10/30 21:58:58  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.1  1996/04/19 21:02:57  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. /* ANSI Standard 4.5: Mathematics <math.h>.  */
  19.  
  20. #ifndef __MATH_H
  21. #define __MATH_H
  22.  
  23. #ifndef __FLOAT_H
  24. #include <float.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. #define HUGE_VAL    DBL_MAX
  32.  
  33. /* Trigonometric functions.  */
  34.  
  35. /* Arc cosine of x.  */
  36. extern double acos (double x);
  37. /* Arc sine of x.  */
  38. extern double asin (double x);
  39. /* Arc tangent of x.  */
  40. extern double atan (double x);
  41. /* Arc tangent of y/x.  */
  42. extern double atan2 (double y,double x);
  43.  
  44. /* Cosine of x.  */
  45. extern double cos (double x);
  46. /* Sine of x.  */
  47. extern double sin (double x);
  48. /* Tangent of x.  */
  49. extern double tan (double x);
  50.  
  51. /* Hyperbolic functions.  */
  52.  
  53. /* Hyperbolic cosine of x.  */
  54. extern double cosh (double x);
  55. /* Hyperbolic sine of x.  */
  56. extern double sinh (double x);
  57. /* Hyperbolic tangent of x.  */
  58. extern double tanh (double x);
  59.  
  60. /* Exponential and logarithmic functions.  */
  61.  
  62. /* Exponentional function of x.  */
  63. extern double exp (double x);
  64. /* Break value into a normalized fracton and an integral power of 2.  */
  65. extern double frexp (double value, int *exp);
  66. /* x times (two to the exp power).  */
  67. extern double ldexp (double x,int exp);
  68. /* Natural logarithm of x.  */
  69. extern double log (double x);
  70. /* Base-ten logarithm of x.  */
  71. extern double log10 (double x);
  72. /* Break value into integral and fractional parts.  */
  73. extern double modf (double value, double *iprt);
  74.  
  75. /* Power functions.  */
  76.  
  77. /* Return x to the y power.  */
  78. extern double pow (double x, double y);
  79. /* Return the square root of x.  */
  80. extern double sqrt (double x);
  81.  
  82. /* Nearest integer, absolute value, and remainder functions.  */
  83.  
  84. /* Smallest integral value not less than X.  */
  85. extern double ceil (double x);
  86. /* Absolute value of X.  */
  87. extern double fabs (double x);
  88. /* Largest integer not greater than X.  */
  89. extern double floor (double x);
  90. /* Floating-point modulo remainder of X/Y.  */
  91. extern double fmod (double x, double y);
  92.  
  93. /* BSD useful constants.  */
  94. #define    M_E        2.7182818284590452354    /* e */
  95. #define    M_LOG2E        1.4426950408889634074    /* log 2e */
  96. #define    M_LOG10E    0.43429448190325182765    /* log 10e */
  97. #define    M_LN2        0.69314718055994530942    /* log e2 */
  98. #define    M_LN10        2.30258509299404568402    /* log e10 */
  99. #define    M_PI        3.14159265358979323846    /* pi */
  100. #define    M_PI_2        1.57079632679489661923    /* pi/2 */
  101. #define    M_PI_4        0.78539816339744830962    /* pi/4 */
  102. #define    M_1_PI        0.31830988618379067154    /* 1/pi */
  103. #define    M_2_PI        0.63661977236758134308    /* 2/pi */
  104. #define    M_2_SQRTPI    1.12837916709551257390    /* 2/sqrt(pi) */
  105. #define    M_SQRT2        1.41421356237309504880    /* sqrt(2) */
  106. #define    M_SQRT1_2    0.70710678118654752440    /* 1/sqrt(2) */
  107.  
  108. #ifdef __cplusplus
  109.     }
  110. #endif
  111.  
  112. #endif
  113.